package com.example.zzh.controller;


import com.example.zzh.entity.ZzhDepotHead;
import com.example.zzh.entity.ZzhProductPrice;
import com.example.zzh.entity.ZzhProductStock;
import com.example.zzh.service.ZzhProductPriceService;
import com.example.zzh.utils.Result;
import com.example.zzh.utils.ResultGenerator;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * <p>
 * 产品价格扩展 前端控制器
 * </p>
 *
 * @author zzh
 * @since 2023-08-13
 */
@RestController
@RequestMapping("/zzh-product-price")
public class ZzhProductPriceController {
    @Autowired
    private ZzhProductPriceService zzhProductPriceService;

    @PostMapping("/findeByBarCode")
    @ApiOperation(value = "查询商品条码", notes = "查询商品条码")
    public Result list(@RequestParam String BarCode) {
        List<ZzhProductPrice> zzhProductPrices=zzhProductPriceService.lambdaQuery().eq(ZzhProductPrice::getBarCode,BarCode).list();
        if(zzhProductPrices.size()>0){
            return ResultGenerator.genErrorResult(200,"找到商品条码");
        }else {
            return ResultGenerator.genErrorResult(404,"未找到商品条码");
        }
    }
}
